<?php
/**
 * OrderProduct.php
 *
 * @copyright  2023 opencart.cn - All Rights Reserved
 * @link       http://www.guangdawangluo.com
 * @author     TL <mengwb@opencart.cn>
 * @created    2023-04-18 19:39:38
 * @modified   2023-04-18 19:39:38
 */

namespace Beike\Seller\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;

class OrderProduct extends \Beike\Models\OrderProduct
{
    protected $fillableExt = ['seller_id', 'store_commission_flat', 'store_commission_percent', 'seller_amount'];

    public function __construct(array $attributes = [])
    {
        $this->fillable = array_merge($this->fillable, $this->fillableExt);
        parent::__construct($attributes);
    }

    public function seller(): BelongsTo
    {
        return $this->belongsTo(Seller::class);
    }

    public function order(): BelongsTo
    {
        return $this->belongsTo(Order::class);
    }
}
